import axios from "axios";

import {prefix} from './api'
import router from "@/router";

export async function login(customer) {
    let obj;
    await axios.post(
        prefix+'/login',
        {   customer }
    ).then(res=>{
       
      
        obj={
           customer:{ ...res.data.customer},
           account:{ ...res.data.account}
        }
    })
    // console.log(obj)
    return obj
}
/**
 * 是否记住登录
 * @param {} params 
 */
export async function ifrememberLogin(customer,account) {
    // let obj={};
    await axios.post(
        prefix+'/ifrememberLogin',
        {
            customer,account
        }
    ).then(res=>{
        customer=res.data.customer
        account=res.data.account
    })
    // console.log('api '+JSON.stringify(customer)+'#')
    return {
        customer,account
    }
}